import request from "@/utils/request.js";

/**
 * 获取月经
 * 
 */
export function getMenstruation({
	year,
	month,
}) {
	return request.get(
		`ep/user/period/getUserPeriod?year=${year}&month=${parseInt(month)}`, {}, {
			noAuth: true
		});
}

/**
 * 获取历史月经月份
 * 
 */
export function getEarliestRecordMonth() {
	return request.get(
		`ep/menstrual-period-calendar/getEarliestRecordMonth`, {}, {
			noAuth: true
		});
}

/**
 * 获取预测月经
 * 
 */
export function getForecastMenstruation({
	year,
	month,
}) {
	return request.get(
		`ep/menstrual-period-calendar/beginPredictTime?year=${year}&month=${month}`, {}, {
			noAuth: true
		});
}

/**
 * 获取排卵黄体卵泡期
 */
export function getOtherPeriod({
	year,
	month,
}) {
	return request.get(
		`ep/menstrual-period-calendar/getOtherPeriod?year=${year}&month=${parseInt(month)}`, {}, {
			noAuth: true
		});
}

/**
 * 添加月经
 * 
 */
export function addMenstruation({
	year,
	month,
	day
}) {
	return request.get(
		`ep/menstrual-period-calendar/predict?year=${year}&month=${month}&day=${day}`, {}, {
			noAuth: true
		});
}
/**
 * 删除月经
 * 
 */
export function delMenstruation({
	year,
	month,
	day
}) {
	return request.get(
		`ep/user/period/deleteUserPeriod?year=${year}&month=${month}&day=${day}`, {}, {
			noAuth: true
		});
}



/**
 * 获取	日常记录
 * 
 */
export function getrecordDaily({
	year,
	month,
	day
}) {
	return request.get(
		`ep/menstrual-period-calendar/getDailyLifeRecord?year=${year}&month=${month}&day=${day}`, {}, {
			noAuth: true
		});
}

/**
 * 多选添加日常记录
 * 
 */
export function addrecordDailys(data) {
	return request.post(	
		`ep/menstrual-period-calendar/batchRecordDailyLife`, data, {
			noAuth: true
		});
}


/**
 * 编辑日常记录
 * 
 */
// export function updaterecordDaily(data) {
// 	return request.post(
// 		`ep/menstrual-period-calendar/updateRecord`, data, {
// 			noAuth: true
// 		});
// }

/**
 * 多选编辑日常记录
 * 
 */
export function updaterecordDailys(data) {
	return request.post(	
		`ep/menstrual-period-calendar/updateRecord`, data, {
			noAuth: true
		});
}


/**
 * 获取经期设置
 * 
 */
export function getMenstruationSetup() {
	return request.get(
		`ep/period/checkEpPeriodAndShow`, {}, {
			noAuth: true
		});
}

/**
 * 更新经期设置
 * 
 */
export function updateMenstruationSetup(data) {
	return request.post(
		`ep/period/updateEpPeriod`, data, {
			noAuth: true
		});
}
getOvulation

/**
 * 获取排卵期
 * 
 */
export function getOvulation({
	year,
	month,
}) {
	return request.post(
		`ep/period/updateEpPeriod?year=${year}&month=${parseInt(month)}`, {}, {
			noAuth: true
		});
}

/**
 * 获取经期天数
 */
export function getPeriod() {
	return request.get(
		`ep/menstrual-period-calendar/getPeriodDay`, {}, {
			noAuth: true
		});
}
